'''
齐次线性方程组满秩的话只有零解！

非满秩：
    x1+x2-x3-x4=0
    2x1-5x2+3x3+2x3=0
    7x1-7x2+3x3+x4=0
'''
import sympy as sp

a = sp.Matrix([[1, 1, -1, -1], [2, -5, 3, 2], [7, -7, 3, 1]])
b = sp.zeros(3, 1)
x = sp.Symbol('x')
x0 = sp.symarray(x, 4).reshape(4, 1)
res = sp.solve(a * x0 - b)
# 解的方程
sp.pprint(res)
# 基础解系
sp.pprint(a.nullspace())
